package com.eportal.action.background;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

import com.eportal.action.BaseAction;
import com.eportal.domain.Sysopt;
import com.eportal.domain.UserScoreLog;
import com.eportal.service.UserScoreLogService;
import com.framework.jqgrid.JqGridPager;
import com.opensymphony.xwork2.ModelDriven;

/**
 * 积分日志管理
 * @author chencheng
 *
 */
public class UserScoreLogAction extends BaseAction implements ModelDriven<UserScoreLog> {

    /**
	 * @author chencheng
	 */
	private static final long serialVersionUID = 1L;

	private static Logger log = Logger.getLogger(UserScoreLogAction.class.getName());

    private Map<String, Object> result = new HashMap<String, Object>();

    @Autowired
    UserScoreLogService userScoreLogService;
    
    /**
     * 积分日志管理
     */
    public String listView() {
        return SUCCESS;
    }
    
    /**
     * 积分日志列表
     */
    public void userScoreLogQuery() throws Exception {
        JqGridPager jqGridPager = new JqGridPager();
        String userId = getRequest().getParameter("userId");
        StringBuilder where = new StringBuilder(" 1=1 ");
        where.append(" and userId = '");
        where.append(userId);
        where.append("'");
    	jqGridPager.setWhere(where.toString());
        setPage(getRequest(), jqGridPager);
        List<Map<String, Object>> UserScoreLog = userScoreLogService.list(jqGridPager);
        jqGridQueryMap(UserScoreLog.class, getRequest(), UserScoreLog, getResponse(), jqGridPager);
    }
    
    private UserScoreLog userScoreLog = new UserScoreLog();

    @Override
    public UserScoreLog getModel() {
        return userScoreLog;
    }
}
